package com.bestdreamer.transdata;

public class Test1 {

    public static void main(String[] args) {
        try{
            String lock = "";
            System.out.println(" sync 上面");
            synchronized (lock){
                System.out.println("sync 第一行");
                lock.wait();
                System.out.println("wait 下的代码！");
            }
            System.out.println("sync 下面的代码");
        }catch (InterruptedException e){
            e.printStackTrace();
        }

    }
}
